//
// Created by gogoqiu on 2021/8/31.
//

#ifndef GITS_GITLISTFRAME_H
#define GITS_GITLISTFRAME_H

#include "wx/wx.h"
#include "GitList.h"
#include "sqlite3.h"

enum
{
    ID_ADD_REPO = 1
};

/**
 * add rep
 * remove rep
 *  双击，对话框确认删除
 * 消息投送
 */
class GitListFrame: public wxFrame {
public:
    GitListFrame();
    ~GitListFrame() override;

private:
    void AddRep( wxCommandEvent& event );
    void RemoveRep( wxMouseEvent& event );
    MyTray *m_Tray;
    vector<Rep* > reps;

    wxBoxSizer *panelRootBoxSizer;
    wxBoxSizer *dialogRootBoxSizer;
    wxScrolledWindow* m_listbox;

    sqlite3 *m_pDb;

    int InitDB();
    int RunSql( const wxString& sql );
    int LoadAll();

    void appendView( Rep* rep );
};


#endif //GITS_GITLISTFRAME_H
